
<template>
	<!-- 选择公司 部门  -->
	<div class="blockItem" v-if="typeClass == 0" :title="dataItem.name">
		<svg-icon :icon-class="dataItem.type == 1 ? 'homepage' : 'tree'"/>
		<span class="blockspan">{{dataItem.name}}</span>
	</div>
	<!-- 审核人员 -->
	 <div class="lineDiv" v-if="typeClass == 1">
		<div v-if="dataItem.avatar" class="lineimgs">
			<img class="lineimg"  :src="dataItem.avatar" alt="">
		</div>
		<span class="blockspan">{{dataItem.name}}</span>
	</div> 
	<!-- 选择用户 -->
	<div class="setUser" v-if="typeClass == 2">
		<div class="setUserLe">
			<div v-if="dataItem.avatar"
					class="setUserLeImgs">
				<img class="setUserLeImg"  :src="dataItem.avatar" alt="">
			</div>
			<span class="setUserLeName">{{dataItem.name}}</span>
		</div>
		<span class="setUserTit">{{dataItem.position}}</span>
	</div>
	 <!-- 仓库管理 -->
	 <div class="blockItem" v-if="typeClass == 3" :title="dataItem.name">
	 	<svg-icon :icon-class="dataItem.type == 1 ? 'homepage' : 'cangku'"/>
	 	<span class="blockspan">{{dataItem.name}}</span>
	 </div>
	 
	 <!-- 选择公司 部门  -->
	 <div class="blockItem" v-if="typeClass == 4" :title="dataItem.name">
		<svg-icon v-if="dataItem.type == 1" icon-class="homepage"/>
	 	<svg-icon v-else-if="dataItem.type == 2" icon-class="tree"/>
			<span  v-if="dataItem.type == 1 || dataItem.type == 2" class="blockspan">
				{{dataItem.name}}
			</span>	
			<span  v-else class="blockspan">{{dataItem.name}} - {{dataItem.position}}</span>		 
	 </div>
	
</template>

<script setup lang="ts">
	const props = defineProps({
	    dataItem: {
	        type: Object,
	        required: true,
	        default: {}
	    },
		typeClass:{
	        type: Number,
	        default: 0
	    },
		nodeItem:{
	        type: Object,
	        default: {}
	    },
	});
</script>

<style lang="scss" scoped>

	.blockItem{
		
	}
	.blockspan{
		margin-left: 5px;
	}
	.lineimg{
		width: 20px;
		height: 20px;
	}
	
	
	
	
	.setUser{
		display: flex;
		justify-content: space-between;
		align-items: center;
		align-content: center;
		.setUserLe{
			display: flex;
			justify-content: flex-start;
			align-items: center;
			align-content: center;
			.setUserLeImgs{
				width: 25px;
				height: 25px;
				border-radius: 4px;
				overflow: hidden;
				.setUserLeImg{
					width: 100%;
					height: 100%;
					display: block;
					object-fit: cover;
				}
			}
			.setUserLeName{
				font-size: 14px;
				margin-left: 6px;
			}
		}
		.setUserTit{
			font-size: 14px;
			
		}
	}
	
</style>